<template>
  <div class="Showcase1">
    <div class="Showcase1-top">
      <img
        class="Showcase1-top-left"
        :src="publicUrls + 'free/style8/Showcase3bg1.webp'"
        alt=""
      />
      <div
        class="Showcase1-top-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style8/Showcase3bg2.webp'})`,
        }"
      ></div>
      <img
        class="Showcase1-top-right"
        :src="publicUrls + 'free/style8/Showcase3bg3.webp'"
        alt=""
      />
    </div>
    <div class="Showcase1-center">
      <img
        class="Showcase1-center-left"
        :src="publicUrls + 'free/style8/Showcase3bg4.webp'"
        alt=""
      />
      <div class="Showcase1-center-center"></div>

      <img
        class="Showcase1-center-right"
        :src="publicUrls + 'free/style8/Showcase3bg6.webp'"
        alt=""
      />
    </div>
    <div class="Showcase1-bottom">
      <div
        :style="{
          left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(index), item.width, 1.201)}rem`,
        }"
        class="ex-item"
        v-for="(item, index) in props.list"
        :key="index"
      >
        <div
          class="name-box"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style8/Showcase3bg10.webp'})`,
          }"
        >
          <span class="name">{{ item.name }}</span>
        </div>
      </div>
      <img
        class="Showcase1-bottom-left"
        :src="publicUrls + 'free/style8/Showcase3bg7.webp'"
        alt=""
      />
      <div
        class="Showcase1-bottom-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style8/Showcase3bg8.webp'})`,
        }"
      ></div>
      <img
        class="Showcase1-bottom-right"
        :src="publicUrls + 'free/style8/Showcase3bg9.webp'"
        alt=""
      />
    </div>
    <!-- Showcase1Topleft -->
  </div>
</template>    

<script lang="ts">
export default defineComponent({
  name: 'style4',
});
</script> 
   
<script setup lang="ts">
import { ShowcaseItemTransform } from '@/utils/setmaterialStyle';
import { publicUrls } from '@/utils/minxin';
import { defineComponent } from 'vue';
const props = defineProps({
  list: {
    type: Object,
  },
});
const getParentX = (indexs: number) => {
  let x = 0;
  for (let index = 0; index < indexs; index++) {
    // const element = array[index];
    x = x + props.list[index].width;
  }

  return x;
};
</script>  

<style scoped lang="less">
.Showcase1 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 500px;
  min-width: 500px;
}
.Showcase1-top {
  display: flex;
  width: 100%;
  height: 14px;
}
.Showcase1-top-left {
  width: 190px;
  height: 14px;
}
.Showcase1-top-center {
  flex: 1;
  height: 14px;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase1-top-right {
  width: 203px;
  height: 14px;
}
.Showcase1-center {
  position: relative;
  display: flex;
  width: 100%;
  height: calc(100% - 258px);
}
.ex-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 68px;
  width: 172px;
  height: 40px;
  z-index: 30;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.name-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  width: 172px;
  height: 40px;

  padding: 6px 13px;
  .name {
    width: 145px;
    height: 28px;
    font-family: SourceHanSerifCN-Bold;
    font-size: 18px;
    color: #FFFFFF;
    line-height: 28px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
  }
}
.Showcase1-center-left {
  width: 190px;
  height: 100%;
}
.Showcase1-center-center {
  flex: 1;
  height: 100%;
}
.Showcase1-center-right {
  width: 203px;
  height: 100%;
}
.Showcase1-bottom {
  position: relative;
  display: flex;
  width: 100%;
  height: 244px;
}
.Showcase1-bottom-left {
  width: 190px;
  height: 244px;
}
.Showcase1-bottom-center {
  position: relative;
  flex: 1; 
  height: 244px;
  background-repeat: no-repeat;
  background-size: 110% 244px;
}
.Showcase1-bottom-right {
  width: 203px;
  height: 244px;
}
</style>